#!/bin/bash
INSTALL_PATH="/home/gonsin/venusOnlineUpdate"
if [ ! -d $INSTALL_PATH ]; then
   mkdir $INSTALL_PATH
fi

apt install -y openjdk-11-jdk

wget -O $INSTALL_PATH/venus_online_update-1.0-SNAPSHOT.jar http://update.gonsincloud.com/en/venusOnlineUpdate/venus_online_update-1.0-SNAPSHOT.jar

cp -f start.sh $INSTALL_PATH/

chmod 755 $INSTALL_PATH/start.sh

cp -f venusOnlineUpdate.service /etc/systemd/system/

chmod 755 /etc/systemd/system/venusOnlineUpdate.service

systemctl daemon-reload

systemctl enable venusOnlineUpdate.service

systemctl start venusOnlineUpdate.service